/**
 * 
 */
package com.ltmt.es.persistence.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author aitor
 *
 */
@Entity
@Table(name="LTMT_HISTORIC_COMBINATIONS")
public class HistoricCombination implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5041201209928528603L;
	
	public HistoricCombination() {
		super();
		// TODO Auto-generated constructor stub
	}

	public HistoricCombination(String code, String date,
			String combination, int complementary) {
		super();
		this.id = null;
		this.code = code;
		this.date = date;
		this.combination = combination;
		this.complementary = complementary;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="HICO_ID")
	private Integer id;
	
	@Column(name="HICO_CODE")
	private String code;
	
	@Column(name="HICO_DATE")
	private String date;
	
	@Column(name="HICO_COMBINATION")
	private String combination;
	
	@Column(name="HICO_COMPLEMENTARY")
	private int complementary;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the date
	 */
	public String getDate() {
		return date;
	}

	/**
	 * @param date the date to set
	 */
	public void setDate(String date) {
		this.date = date;
	}

	/**
	 * @return the combination
	 */
	public String getCombination() {
		return combination;
	}

	/**
	 * @param combination the combination to set
	 */
	public void setCombination(String combination) {
		this.combination = combination;
	}

	/**
	 * @return the complementary
	 */
	public int getComplementary() {
		return complementary;
	}

	/**
	 * @param complementary the complementary to set
	 */
	public void setComplementary(int complementary) {
		this.complementary = complementary;
	}

	/**
	 * @return the serialversionuid
	 */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		result = prime * result
				+ ((combination == null) ? 0 : combination.hashCode());
		result = prime * result + complementary;
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + id;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HistoricCombination other = (HistoricCombination) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		if (combination == null) {
			if (other.combination != null)
				return false;
		} else if (!combination.equals(other.combination))
			return false;
		if (complementary != other.complementary)
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (id != other.id)
			return false;
		return true;
	}

}
